var submitForm = ''
$(window).ready(initValidate);

function initValidate(){
	submitForm = $('#submitForm')[0];
	submitForm.validators = new Array();
	var inputEl = document.getElementsByName('task.taskName')[0];
	submitForm.validators.push(new NullValidator(inputEl, "任务名称不能为空",$(inputEl).next()[0],true));
	inputEl = document.getElementsByName('task.ownerId')[0];
	submitForm.validators.push(new NullValidator(inputEl, "负责人不能为空",$(inputEl).next()[0],true));
	inputEl = document.getElementsByName('task.startDate')[0];
	submitForm.validators.push(new NullValidator(inputEl, "开始时间不能为空",$(inputEl).next()[0],true));
	inputEl = document.getElementsByName('task.endDate')[0];
	submitForm.validators.push(new NullValidator(inputEl, "结束时间不能为空",$(inputEl).next()[0],true));
	inputEl = document.getElementsByName('task.content')[0];
	submitForm.validators.push(new CharacterLengthValidator(inputEl, 1024, "长度不能超过1024",$(inputEl).next()[0],true));
	submitForm.validators.push(new NullValidator(inputEl, "任务内容不能为空",$(inputEl).next()[0],true));
}
function doValidate(event){
	formSubmitRequest(event,submitForm);
}